import request from '@/utils/request';

// 申报明细表
// 列表接口
export async function getPageList(params) {
  return request(`/csApi/fmPay/pageList`, {
    method: 'POST',
    body: params,
  });
}

export async function insertFmPay(params) {
  return request(`/csApi/fmPay/insertFmPay`, {
    method: 'POST',
    body: params,
  });
}

export async function getSecond(params) {
  return request(`/csApi/fmPay/getInsertData`, {
    method: 'POST',
    body: params,
  });
}

export async function getFmPay(params) {
  return request(`/csApi/fmPay/getFmPay`, {
    method: 'POST',
    body: params,
  });
}

export async function getRrtData(params) {
  return request(`/csApi/fmPay/getRrtData`, {
    method: 'POST',
    body: params,
  });
}

export async function cancleFmPay(params) {
  return request(`/csApi/fmPay/cancleFmPay`, {
    method: 'POST',
    body: params,
  });
}

export async function queryDictItemsByCodes(params) {
  return request(`/csApi/mdm/nmDict/queryDictItemsByCodes`, {
    method: 'POST',
    body: params,
  });
}

export async function fetchSubmitList(params) {
  let url = '';
  switch (params.payapplytype) {
    case '1':
      url = params.switchFlag
        ? '/esApi/accuRefundInfo/pageListClaimAccuRefundInfo'
        : '/esApi/insRefundInfo/pageListClaimInsRefundInfo';
      break;
    case '2':
      url = '/csApi/csBill/getPayList';
      break;
    case '3':
      url = params.switchFlag
        ? '/esApi/accuRefundInfo/pageListClaimAccuRefundInfo'
        : '/esApi/insRefundInfo/pageListClaimInsRefundInfo';
      break;
    case '4':
      url = params.switchFlag
        ? '/nsApi/oncefeePay/queryBillingOnce'
        : '/nsApi/nsBillPay/getPayList';
      break;
    case '5':
      url = '/osApi/insBillApi/getBillListForOthers';
      break;
    case '6':
      url = '/osApi/accuBillApi/getBillListForOthers';
      break;
    default:
      break;
  }
  return request(url, {
    method: 'POST',
    body: params.params,
  });
}
